package src.VO;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.openswing.swing.message.receive.java.ValueObjectImpl;


/**
 * The persistent class for the accounts database table.
 * 
 */
@Entity(name="accounts")
public class AccountVO extends ValueObjectImpl implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	@Column(updatable=false)
	private int account;

    @Temporal( TemporalType.DATE)
	@Column(name="date_reg")
	private Date dateReg;

    @Temporal( TemporalType.DATE)
	@Column(name="date_valid")
	private Date dateValid;

	//uni-directional many-to-one association to Card
    @ManyToOne
	@JoinColumn(name="idcard")
	private CardVO card;

	//uni-directional many-to-one association to Client
    @ManyToOne
	@JoinColumn(name="clients_idclients")
	private ClientVO client;

    public AccountVO() {
    }

	public AccountVO(int account, Date dateReg, Date dateValid, CardVO card,
			ClientVO client) {
		this.account = account;
		this.dateReg = dateReg;
		this.dateValid = dateValid;
		this.card = card;
		this.client = client;
	}

	public int getAccount() {
		return this.account;
	}

	private void setAccount(int account) {
		this.account = account;
	}

	public Date getDateReg() {
		return this.dateReg;
	}

	public void setDateReg(Date dateReg) {
		this.dateReg = dateReg;
	}

	public Date getDateValid() {
		return this.dateValid;
	}

	public void setDateValid(Date dateValid) {
		this.dateValid = dateValid;
	}

	public CardVO getCard() {
		return this.card;
	}

	public void setCard(CardVO card) {
		this.card = card;
	}
	
	public ClientVO getClient() {
		return this.client;
	}

	public void setClient(ClientVO client) {
		this.client = client;
	}
	
}